Clinical AI Kit home Documentation hub / Clinical App

Clinical App

The clinician-facing product: a React frontend served by a FastAPI server that runs in deterministic demo mode by default or bridges live to the ADK agent backend.

Components

Module Purpose
clinical_app/app.py FastAPI routes for the clinician-facing application; middleware; serves frontend/dist/
clinical_app/agent_runtime.py Deterministic product adapters for the real clinical agent tool layer
clinical_app/live_bridge.py Lazy Google ADK execution bridge for live product mode
clinical_app/repository.py Session-isolated mutable repository for deterministic product demos
clinical_app/models.py Pydantic contracts for the clinician product API
clinical_app/document.py Document parsing and upload policy for clinical evidence files
frontend/ React/Vite/TypeScript UI — 16 core product screens plus 3 documentation/utility routes

Additional frontend documentation surfaces:

Module Purpose
frontend/src/diagrams.ts Typed diagram catalog used by the product atlas and contextual embeds
frontend/src/components/DiagramAtlas.tsx Category tabs, diagram sub-tabs, viewer, and summary panel
frontend/src/components/InlineDiagram.tsx Collapsible contextual architecture embed for workflow screens

Onboarding tour

frontend/src/Onboarding.tsx runs a full-takeover guided tour the first time a user enters the workspace (/app/*). The modal is the focal point while the real screens render dimmed behind it; each of the 9 steps navigates the actual route it describes (dashboard → queue → extraction → Q&A → database → inbox → orchestrator → finish) and the AI workflow steps play deterministic in-modal simulations (agent pipeline, cited answer, SQL-to-chart) with zero API calls.

Diagram atlas routing

The app exposes Diagram Atlas in the public landing page and inside the product shell:

Route Visible architecture
/ Full diagram atlas with category tabs and diagram sub-tabs
/app/dashboard Compact System atlas below clinician quick actions
/app/admin Compact System atlas below admin KPIs and health panels
/app/configuration Agent hierarchy inline diagram on monitoring
/app/configuration?view=settings Security pipeline inline diagram on safety settings
/app/storage Memory architecture inline diagram in storage overview
/app/inbox Human-in-the-loop BPMN inline diagram below the review workspace
/app/extraction Document ingestion flow beside source controls
/app/qa Chat turn sequence beside patient context and knowledge-base upload
/app/database Clinical database ERD beside schema explorer

Tenancy

Three tenants are selectable from the organization dropdown in the Shell topbar (visible to both roles); the frontend sends the choice in the X-Tenant header and clinical_app/tenancy.py is the single registry:

Tenant Kind Data
Research Clinic (default) demo Original deterministic 24-patient dataset
Northstar Health demo Distinct deterministic 12-patient dataset (NORTHSTAR_* fixtures in repository.py)
Capstone real Live ADK execution over its own capstone.db + uploads_capstone/, created schema-only and empty

Demo vs live mode

Product guarantees

Running

.venv\Scripts\python.exe -m uvicorn clinical_app.app:app --reload --port 8000

FastAPI serves the frontend build at http://localhost:8000. During frontend development, npm run dev in frontend/ proxies /api to port 8000.

Related: System Overview · End-to-End Request Flow · Testing and Eval · REST API and Developer Console